<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="orest.back.membermanage.RegisterUserHandler"%>
<%@page import="net.ssta.core.db.RecordSet"%>
<%@page import="net.ssta.core.db.Record"%>
<%@page import="net.ssta.core.web.HTMLGenerator"%>
<%@page import="orest.back.userneeds.UserNeedsHandler"%>
<%@page import="orest.front.achieve.AchieveHandler"%>

<%
	String path = request.getContextPath();
    String flag=request.getParameter("flag");
    
    String userId=request.getParameter("userId");
    Record r=RegisterUserHandler.getUserById(userId);
    UserNeedsHandler handler=new UserNeedsHandler();
    Record empty=new Record();
    empty.addData("OPTIONVALUE","");
    empty.addData("OPTIONNAME","请选择");
    empty.addData("PROVINCE_ID","");
    empty.addData("PROVINCE_NAME","请选择");
    RecordSet zdxx=new RecordSet();
    RecordSet province=new RecordSet();
    zdxx.add(empty);
    province.add(empty);
    zdxx.add(AchieveHandler.getNewEnergyClassList());
    
    province.add(handler.getAllProvince());
    
%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<link type="text/css" rel="stylesheet" href="<%=path %>/includes/css/commonStyle.css"/> 




<script type='text/javascript' src="<%=path %>/includes/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/includes/styleBase/js/style.js"></script>
<script type="text/javascript" src="<%=path %>/includes/DatePicker/WdatePicker.js"></script>


<script type="text/javascript" src="<%=path %>/includes/lhgdialog/lhgcore.min.js"></script>
<script type="text/javascript" src="<%=path %>/includes/lhgdialog/lhgdialog.js"></script>

<script type="text/javascript" src="<%=path %>/includes/Fvalidate/Fvalidate.js" ></script>
<link type="text/css" rel="stylesheet" href="<%=path %>/includes/Fvalidate/style.css" />
 
<title>增加前台用户</title>
 
<script type="text/javascript">

var dg = frameElement.dg;

$(document).ready(function()
{
    dg.addBtn( 'save', '保存', save );
	dg.addBtn( 'cancel', '取消', cancel );
	
	if("<%=flag%>"=="true"){
	    alert("修改用户成功!");
	    dg.cancel();
	    dg.win.reloadPage();
	}
});


function checkForm(){
   if(!$("#search").Fvalidate()){
    return false;
  }
   
   document.userFrom.submit();
   return true;
}        
function cancel()
{
  dg.cancel();
}

function save()
{
	checkForm();
}
  
</script>



<style>
body, html {
	margin:0;
	padding:0;
}
	.ctable{
		font-size:12px;
		cellPadding:0px;
		cellSpacing:0px;
		background-color:#F6F9FF;
		
		} 
 
		.ctable tr{
		height:24px; 
		} 
		.ctable tr td{ 
		border:0px;
		border-top:1px #99bbe8 solid; 
		border-right:1px #99bbe8 solid;
		padding:5px; 
		vertical-align:middle;
		}
</style>

 
 
 
</head>
<body>
<form id="search" action="<%=path %>/back/userManager?method=modUser"  name="userFrom" method="post">
<input name="user_USERID" value="<%=r.getString("USERID","") %>" type="hidden"/>
<div class="multiEditPanel" style="border:0;padding:10px;width:90%;padding-left:20px;">
  <table cellpadding="0" align="center" cellspacing="0" border="0" class="ctable" width=90% style="border-left:1px solid #99bbe8;border-bottom:1px solid #99bbe8;border-right:0px solid red;">
    <tr >
      <td width="30%">用户名：</td>
      <td >
      	<input type="text"  maxlength="20" style="width:120px;" name="user_USERNAME" class="textInput"   id="userName"   value="<%=r.getString("LOGINNAME") %>" readonly/>
      </td>
     </tr>
     
     <tr >
      <td>性别：</td>
      <td>
	  	<input type="radio" value="男" name="user_SEX" <%="男".equals(r.getString("SEX","男"))?"checked":"" %>/>男
	  	<input type="radio" value="女" name="user_SEX"  <%="男".equals(r.getString("SEX","男"))?"":"checked" %>/>女
	  </td>
    </tr>
    
    
     <tr >
      <td>真实姓名：</td>
      <td>
	  	<input type="text" name="user_FULLNAME" class="textInput" style="width:120px;" value="<%=r.getString("FULLNAME","") %>"/>
	  </td>
    </tr>
    
        
     <tr >
      <td>Email：</td>
      <td>
	  	<input type="text"  maxlength="20" style="width:120px;" class="textInput" name="user_EMAIL" rule="email"  value="<%=r.getString("EMAIL","") %>" error="请输入正确的邮箱地址" label="Email"/>
	  </td>
    </tr>
    
        
        
     <tr >
      <td>出生年月：</td>
      <td>
        <%String birthDay=r.getString("BIRTHDAY","");
        	   if(birthDay.length()>10){
        		   birthDay=birthDay.substring(0,10);
        	 } %> 
      
	  	<input type="text"  maxlength="20" style="width:120px;" class="textInput" name="user_BIRTHDAY" value="<%=birthDay %>" readonly  onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
	  </td>
    </tr>
    
    
            
 
    <tr >
      <td>所在行业：</td>
      <td>
        <%=HTMLGenerator.getSelectElementHtml("name='user_INDUSTRY' style='width:180px;'",zdxx,"OPTIONVALUE","OPTIONNAME",r.getString("INDUSTRY",""))%>
	  </td>
    </tr>
    
    
    
     <tr >
      <td>工作单位：</td>
      <td>
	  	<input type="text"  maxlength="20" style="width:180px;" class="textInput"   name="user_WORKORG" value="<%=r.getString("WORKORG","") %>"/>
	  </td>
    </tr>
    
 
    
    
     <tr >
      <td>电话：</td>
      <td>
	  	<input type="text"  maxlength="20" style="width:180px;" class="textInput"   name="user_TELEPHONE" value="<%=r.getString("TELEPHONE","") %>"/>
	  </td>
    </tr>
    
    <tr >
      <td>所在省市：</td>
      <td> 
          <%=HTMLGenerator.getSelectElementHtml("name='user_PROVINCE' style='width:180px;'",province,"PROVINCE_ID","PROVINCE_NAME",r.getString("PROVINCE",""))%>
   	  </td>
    </tr>
    
     <tr >
      <td>会员类型：</td>
      <td>
	  	<input type="radio" value="0" name="user_MEMBERTYPE" <%="0".equals(r.getString("MEMBERTYPE",""))?"checked":"" %>/>个人
	  	<input type="radio" value="1" name="user_MEMBERTYPE" <%="1".equals(r.getString("MEMBERTYPE",""))?"checked":"" %>/>企业
	  </td>
    </tr>
    
  </table>
</div>
</form>
</body> 
</html>